package com.example.learnx.controller;

import com.example.learnx.model.dto.SuperiorRequest;
import com.example.learnx.model.dto.UpdateStudentRequest;
import com.example.learnx.service.SysUserService;
import com.sun.istack.internal.NotNull;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    SysUserService sysUserService;

    /**
     * 复学，退伍，转专业
     * @param updateStudentRequest
     * @return
     */
    @PutMapping("/updateStudent")
    public Boolean updateStudent(@NotNull @RequestBody UpdateStudentRequest updateStudentRequest){

        return sysUserService.updateInfo(updateStudentRequest);
    }

    /**
     * 老师查看不了学生
     * @param superiorRequest
     * @return
     */
    @PutMapping("/permission")
    public Boolean permission(@NotNull @RequestBody SuperiorRequest superiorRequest){

        return sysUserService.setSuperior(superiorRequest);
    }

    /**
     * 解决账号登录后，不能进去显示过期问题
     * @param studentAccount
     * @return
     */
    @GetMapping("/status")
    public String  setStatus(@NotNull String studentAccount){

        return sysUserService.setStatus(studentAccount);
    }

    @GetMapping
    public String st(String acount,String password){
        return "wo";
    }

}
